package org.rkuk.kasutil.test.system.handler 
{
	import flash.events.EventDispatcher;
	import org.rkuk.kasutil.test.event.AnsyTimeoutEvent;
	import org.rkuk.kasutil.test.framework.TestMethod;
	import org.rkuk.kasutil.test.util.AnsyEventTimer;
	
	/**
	 * ...
	 * @author rkuk
	 */
	public class AnsyTimeoutHandler extends AnsyHandler 
	{
		private var timer_:AnsyEventTimer;
		
		public function AnsyTimeoutHandler(timeout:int, eventTarget:EventDispatcher, eventType:String, eventMethod:TestMethod)
		{
			super(timer_ = new AnsyEventTimer(timeout, eventTarget, eventType), AnsyTimeoutEvent.TIMEOUT, eventMethod);
		}
		
		override public function start():void 
		{
			super.start();
			timer_.start();
		}
		
		override public function stop():void 
		{
			super.stop();
			timer_.stop();
			timer_ = null;
		}
	}
}